<?php

namespace common\models\DAO;

use Yii;

/**
 * This is the model class for table "mx_user".
 *
 * @property string $id
 * @property string $encrypt
 * @property integer $status
 * @property string $loginPassword
 * @property string $phone
 * @property string $createTime
 * @property string $updateTime
 * @property string $realName
 * @property string $paterID
 * @property string $grandpaID
 * @property string $grandfatherID
 * @property string $openID
 * @property string $unionID
 * @property string $province
 * @property string $city
 * @property integer $sex
 * @property integer $age
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'mx_user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['status', 'createTime', 'updateTime', 'paterID', 'grandpaID', 'grandfatherID', 'sex', 'age'], 'integer'],
            [['encrypt'], 'string', 'max' => 6],
            [['loginPassword'], 'string', 'max' => 32],
            [['phone'], 'string', 'max' => 30],
            [['realName'], 'string', 'max' => 10],
            [['openID', 'unionID'], 'string', 'max' => 100],
            [['province', 'city'], 'string', 'max' => 20],
            [['phone'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '主键id',
            'encrypt' => '加密盐',
            'status' => '用户状态：-1：黑名单；0：未启用；1：正常',
            'loginPassword' => '登陆密码',
            'phone' => '手机号码',
            'createTime' => '注册时间',
            'updateTime' => '更新时间',
            'realName' => '姓名',
            'paterID' => '父id',
            'grandpaID' => '爷爷id',
            'grandfatherID' => '祖爷爷id',
            'openID' => 'openID',
            'unionID' => 'unionid',
            'province' => '省份',
            'city' => '城市',
            'sex' => '性别',
            'age' => '年龄',
        ];
    }
}
